<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head th:replace="common/htmlHead :: common_header(~{::title})">
    <title>病患信息</title>
</head>
<body>
<!-- loader Start -->
<div id="loading">
    <div id="loading-center">
    </div>
</div>
<!-- loader END -->
<!-- Wrapper Start -->
<div class="wrapper">
    <!-- 侧边栏  -->
    <head th:replace="~{common/sidebar}">
        <!-- Page Content  -->
        <div id="content-page" class="content-page">
            <!-- 导航栏 -->
            <div th:replace="~{common/topbar}"></div>
            <!-- 导航栏结束 -->
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="iq-card">
                            <div class="iq-card-header d-flex justify-content-between">
                                <div class="iq-header-title">
                                    <h4 class="card-title">患者列表</h4>
                                </div>
                            </div>
                            <div class="iq-card-body">
                                <div id="table" class="table-editable">
                              <span class="table-add float-right mb-3 mr-2">
                                 <a th:href="@{/toAddPatientInfo}">
                              <button class="btn btn-sm iq-bg-success"><i class="ri-add-fill"><span
                                      class="pl-1">增加患者</span></i>
                              </button>
                                 </a>
                              </span>
                                    <table class="table table-bordered table-responsive-md table-striped text-center">
                                        <thead>
                                        <tr>
                                            <th>单号</th>
                                            <th>病人名字</th>
                                            <th>疾病</th>
                                            <th>诊断日期</th>
                                            <th>病情发展</th>
                                            <th>联系邮箱</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr class="hide" th:each="patientInfo:${patientInfos}">
                                            <td th:text="${patientInfo.getUUID()}"></td>
                                            <td th:text="${patientInfo.getPatientName()}"></td>
                                            <td th:text="${patientInfo.getDisease()}"></td>
                                            <td th:text="${patientInfo.getAdmissionDate()}"></td>
                                            <td th:text="${patientInfo.getHealth()}"></td>
                                            <td th:text="${patientInfo.getEmail()}"></td>
                                            <td>
                                                <a th:href="@{/toEmail/}+${patientInfo.getEmail()}">
                                                    <button class="btn btn-sm btn-success">联系</button>
                                                </a>
                                                <a th:href="@{/getPatientInfoByUUID/}+${patientInfo.getUUID()}">
                                                    <button class="btn btn-sm btn-primary">修改</button>
                                                </a>
                                                <a th:href="@{/delPatientInfoByUUID/}+${patientInfo.getUUID()}">
                                                    <button class="btn btn-sm btn-danger">删除</button>
                                                </a>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 脚部 -->
            <footer th:replace="~{common/footer}"></footer>
            <!-- 脚部结束 -->
        </div>
    </head>
</div>
<!-- Wrapper END -->
<!--使用公有js-->
<div th:replace="common/htmlHead::common_js(~{::script})">

</div>
</body>
</html>